package com.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.stereotype.Component;

import javax.validation.constraints.Email;
import javax.validation.constraints.Pattern;
import java.sql.Timestamp;

/**
 * @ClassName User
 * @Description 用户信息，手机号 邮箱校验
 * @Author XiangQian
 * @Date 2022/7/6 16:32
 */


@ApiModel("用户表")
@Component
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {

    @Id
    @ApiModelProperty(value = "用户Id")
    private long id;

    @ApiModelProperty(value = "用户名")
    private String name;

    @ApiModelProperty(value = "手机号")
    @Pattern(regexp = "^[\\d\\*]{11}$", message = "联系手机号输入有误")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    @Email(message = "邮箱格式发生错误")
    private String email;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "状态")
    private int status;

    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @ApiModelProperty(value = "最后更新时间")
    private Timestamp latestTime;

    @ApiModelProperty(value = "删除时间")
    private Timestamp deleteTime;

}
